<?php

use Illuminate\Http\Request;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

Route::middleware('auth:api')->get('/user', function (Request $request) {
    return $request->user();
});

/**
 * 迁移数据
 */
Route::group(['prefix' => 'move', 'namespace' => 'Api'], function () {
    Route::post('cate', 'MoveController@moveCate');           //迁移分类
    Route::post('owner', 'MoveController@moveBoxOwner');      //迁移盒子用户
    Route::post('box', 'MoveController@moveBox');             //迁移盒子
    Route::post('attribute', 'MoveController@moveAttribute'); //迁移规格
    Route::post('supply', 'MoveController@moveSupply');      //迁移供应商
    Route::post('keyword', 'MoveController@moveKeyword');      //迁移热门关键词
    Route::post('brand', 'MoveController@moveBrand');       //迁移品牌
    Route::post('product', 'MoveController@moveProduct');      //迁移商品
    Route::post('detail', 'MoveController@moveDetail');      //迁移商品详情
    Route::post('share', 'MoveController@moveShare');      //迁移商品分佣
    Route::post('good_cat', 'MoveController@moveGoodCat');      //迁移商品分类
});

/**
 * 微信支付回调
 */
Route::group(['prefix' => 'notify', 'namespace' => 'Api'], function () {
    Route::post('pay', 'NotifyController@payNotify');           //微信支付回调结果接收
    Route::post('member', 'NotifyController@memberNotify');     //会员充值支付回调
    Route::post('query', 'NotifyController@queryNotify');      //微信订单查询
    Route::get('live', 'NotifyController@liveNotify');        //直播录播通知
});

/**
 * 客户端登录
 */
Route::group(['prefix' => 'login', 'namespace' => 'Api'], function () {
    Route::post('check', 'LoginController@checkLogin');           //用户登录页面
});

/**
 * 客户端直播
 */
Route::group(['prefix' => 'live', 'namespace' => 'Api', 'middleware' => ['api_check']], function () {
    Route::post('list', 'LiveController@listLive');           //直播列表页
    Route::post('detail', 'LiveController@infoLive');         //直播详情
    Route::post('poster', 'LiveController@posterLive');       //直播海报生成
});

/**
 * 客户端积分商
 */
Route::group(['prefix' => 'integral', 'namespace' => 'Api', 'middleware' => ['api_check']], function () {
    Route::post('personal', 'IntegralController@personalIntegral');         //个人积分查询
    Route::post('income', 'IntegralController@incomeIntegral');             //个人积分记录
    Route::post('goods', 'IntegralController@goodsIntegral');               //积分商品
    Route::post('exchange', 'IntegralController@exchangeIntegral');         //积分兑换记录
});

/**
 * 客户端短视频列表
 */
Route::group(['prefix' => 'video', 'namespace' => 'Api', 'middleware' => ['api_check']], function () {
    Route::post('list', 'ShortVideoController@listVideo');     //短视频列表
    Route::post('cart', 'ShortVideoController@cartVideo');     //短视频加购
    Route::post('play', 'ShortVideoController@playVideo');     //短视频播放
    Route::post('collect', 'ShortVideoController@collectVideo');     //短视频收藏
    Route::post('click', 'ShortVideoController@clickVideo');     //短视频点击
    Route::post('page', 'ShortVideoController@pageVideo');       //短视频页面
    Route::post('detail', 'ShortVideoController@detailVideo');   //短视频详情
});

/**
 * 客户端推广信息
 */
Route::group(['prefix' => 'extend', 'namespace' => 'Api', 'middleware' => ['api_check']], function () {
    Route::post('temp', 'ExtendController@tempExtend');             //临时用户信息
    Route::post('invite', 'ExtendController@inviteExtend');         //累积邀请人
    Route::post('good', 'ExtendController@goodExtend');             //推广商品
    Route::post('share', 'ExtendController@shareExtend');            //推广商品分享
});

/**
 * 客户端用户信息
 */
Route::group(['prefix' => 'user', 'namespace' => 'Api', 'middleware' => ['api_check']], function () {
    Route::post('info', 'UserController@infoUser');             //用户信息更新
    Route::post('coupon', 'UserController@couponUser');         //用户优惠券列表
    Route::post('center', 'UserController@centerUser');         //用户个人中心
    Route::post('upload', 'UserController@uploadUser');         //用户上传图片
    Route::post('member', 'UserController@memberUser');         //用户会员信息
    Route::post('poster', 'UserController@posterUser');         //用户海报分享
    Route::post('basic', 'UserController@basicUser');           //用户基本资料修改
    Route::post('avatar', 'UserController@avatarUser');         //用户头像修改
});

/**
 * 客户端佣金信息
 */
Route::group(['prefix' => 'commission', 'namespace' => 'Api', 'middleware' => ['api_check']], function () {
    Route::post('total', 'CommissionController@totalCommission');           //佣金列表
    Route::post('detail', 'CommissionController@detailCommission');         //佣金明细
    Route::post('withdraw', 'CommissionController@withdrawCommission');     //申请提现
    Route::post('process', 'CommissionController@processCommission');       //查看提现进度
    Route::post('record', 'CommissionController@recordCommission');         //查看提现记录
});

/**
 * 客户端会员信息
 */
Route::group(['prefix' => 'member', 'namespace' => 'Api', 'middleware' => ['api_check']], function () {
    Route::post('shop', 'MemberController@shopMember');         //会员招募页面
});

/**
 * 显示折扣页面
 */
Route::group(['prefix' => 'limit', 'namespace' => 'Api', 'middleware' => ['api_check']], function () {
    Route::post('goods', 'LimitController@limitGoods');         //显示折扣商品
});

/**
 * 申请推广员
 */
Route::group(['prefix' => 'promoter', 'namespace' => 'Api', 'middleware' => ['api_check']], function () {
    Route::post('code', 'PromoterController@codePromoter');         //发送验证码
    Route::post('confirm', 'PromoterController@confirmPromoter');   //申请推广员
});

/**
 * 客户端订单售后
 */
Route::group(['prefix' => 'after', 'namespace' => 'Api', 'middleware' => ['api_check']], function () {
    Route::post('total', 'AfterController@totalAfter');           //用户所有订单
    Route::post('cancel', 'AfterController@cancelAfter');         //用户取消订单
    Route::post('delete', 'AfterController@deleteAfter');         //用户删除订单
    Route::post('confirm', 'AfterController@confirmAfter');        //用户确认订单
    Route::post('detail', 'AfterController@detailAfter');         //用户订单详情
    Route::post('address', 'AfterController@addressAfter');        //用户修改订单地址
    Route::post('comment', 'AfterController@commentAfter');        //用户评价订单
    Route::post('evaluate', 'AfterController@evaluateAfter');        //用户评价多商品订单
    Route::post('express', 'AfterController@expressAfter');        //用户查看订单物流
    Route::post('continue', 'AfterController@continueAfter');      //用户继续支付订单
});

/**
 * 客户端用户地址
 */
Route::group(['prefix' => 'address', 'namespace' => 'Api', 'middleware' => ['api_check']], function () {
    Route::post('append', 'AddressController@appendAddress');     //用户地址信息添加
    Route::post('delete', 'AddressController@deleteAddress');     //用户地址信息删除
    Route::post('edit', 'AddressController@editAddress');         //用户地址信息编辑
    Route::post('list', 'AddressController@listAddress');         //用户地址信息列表
});

/**
 * 客户端优惠券
 */
Route::group(['prefix' => 'coupon', 'namespace' => 'Api', 'middleware' => ['api_check']], function () {
    Route::post('center', 'CouponController@centerCoupon');      //优惠券领券中心
    Route::post('fetch', 'CouponController@fetchCoupon');        //用户领取优惠券
    Route::post('delete', 'CouponController@deleteCoupon');      //用户删除优惠券
});

/**
 * 客户端订单
 */
Route::group(['prefix' => 'order', 'namespace' => 'Api', 'middleware' => ['api_check']], function () {
    Route::post('prepare', 'OrderController@prepareOrder');      //订单预下单
    Route::post('settle', 'OrderController@settleOrder');        //订单结算页详情
    Route::post('calc', 'OrderController@calcOrder');            //订单结算页计算价格
});

/**
 * 客户端售后操作
 */
Route::group(['prefix' => 'market', 'namespace' => 'Api', 'middleware' => ['api_check']], function () {
    Route::post('refund', 'MarketController@refundMarket');         //申请退款操作
    Route::post('return', 'MarketController@returnMarket');         //申请退货操作
    Route::post('exchange', 'MarketController@exchangeMarket');     //申请退款退货操作
    Route::post('process', 'MarketController@processMarket');       //售后进度查询
    Route::post('detail', 'MarketController@detailMarket');         //售后订单详情
    Route::post('cancel', 'MarketController@cancelMarket');         //售后订单取消
    Route::post('modify', 'MarketController@modifyMarket');         //售后订单修改
});

/**
 * 客户端购物车
 */
Route::group(['prefix' => 'cart', 'namespace' => 'Api', 'middleware' => ['api_check']], function () {
    Route::post('list', 'CartController@listCart');             //用户购物车列表
    Route::post('modify', 'CartController@modifyCart');         //用户修改购物车
    Route::post('delete', 'CartController@deleteCart');         //用户删除购物车
    Route::post('collect', 'CartController@collectCart');       //用户添加购物车
    Route::post('integral ', 'CartController@integralCart');    //用户积分兑换
});

/**
 * 客户端搜索记录
 */
Route::group(['prefix' => 'history', 'namespace' => 'Api', 'middleware' => ['api_check']], function () {
    Route::post('search', 'HistoryController@searchHistory');     //保留搜索记录
    Route::post('list', 'HistoryController@listHistory');         //展示搜索记录
    Route::post('clear', 'HistoryController@clearHistory');       //清空搜索记录
});

/**
 * 客户端首页模板
 */
Route::group(['prefix' => 'index', 'namespace' => 'Api', 'middleware' => []], function () {
    Route::post('show', 'IndexController@showIndex');           //首页模板显示
    Route::post('personal', 'IndexController@personalIndex');   //我的页面模板显示
    Route::post('cart', 'IndexController@cartIndex');           //购物车模板显示
    Route::post('live', 'IndexController@liveIndex');           //直播页面模板显示
    Route::post('recruit', 'IndexController@recruitIndex');     //会员招募模板显示
    Route::post('pay', 'IndexController@payIndex');             //支付结果模板显示
});

/**
 * 客户端分类首页模板
 */
Route::group(['prefix' => 'category', 'namespace' => 'Api', 'middleware' => []], function () {
    Route::post('show', 'CategoryController@showCategory');      //分类模板显示
    Route::post('data', 'CategoryController@dataCategory');      //分类内容数据
});


/**
 * 客户端杂项内容
 */
Route::group(['prefix' => 'sundry', 'namespace' => 'Api', 'middleware' => []], function () {
    Route::post('hot', 'SundryController@hotSundry');               //热门关键词
    Route::post('template', 'SundryController@templateSundry');     //专题模板内容
});

/**
 * 客户端商品列表
 */
Route::group(['prefix' => 'good', 'namespace' => 'Api', 'middleware' => []], function () {
    Route::post('list', 'GoodsController@listGoods');           //商品列表页
    Route::post('detail', 'GoodsController@detailGoods');       //商品详情页
    Route::post('comment', 'GoodsController@commentGoods');     //商品评价页
    Route::post('hot', 'GoodsController@hotGoods');             //热门商品
    Route::post('material', 'GoodsController@materialGoods');   //商品发圈素材
    Route::post('poster', 'GoodsController@posterGoods');       //商品详情分享
});
